﻿@model KarReq.WebUI.Models.QueueIndexViewModel

@{
    ViewBag.Title = "KarReq: Your Queue";
}

<h2>Your queue</h2>
<table width="90%" align="center">
    <thead><tr>
        <th align="center">Position</th>
        <th align="left">Artist</th>
        <th align="left">Song</th>
    </tr></thead>
    <tbody>
        @{int i = 1;
            foreach(var request in Model.Requests) {
                <tr>
                    <td align="center">@i</td>
                    <td align="left">@request.KaraokeTrack.Artist</td>
                    <td align="left">@request.KaraokeTrack.Song</td>
                    <td>
                        @using (Html.BeginForm("RemoveFromQueue", "Queue")) {
                            @Html.Hidden("karaokeTrackId", request.KaraokeTrack.KaraokeTrackID)
                            @Html.HiddenFor(x => x.ReturnUrl)
                            <input class="actionButtons" type="submit" value="Remove" />
                        }
                    </td>
                </tr>
                i++;
            }
        }
    </tbody>
</table>
<p align="center" class="actionButtons">
    @using (Html.BeginForm("ClearQueue", "Queue"))
    {
        @Html.HiddenFor(x => x.ReturnUrl)
        <input class="actionButtons" type="submit" value="Clear Queue" />
    }
    <a href="@Model.ReturnUrl">Back</a>
</p>